import { useState } from "react";
import ContextTo from "./context_js";
import Context_one from "./ContextChild1";
import Context_two from "./ContextChild2";
const Context_mun =()=>{
    const[todo,setTodo]=useState(state)
    const updateList=(item)=>{
        let objTodo ={...todo}
        objTodo.todoList.push(item)
        
        setTodo(objTodo)
    }
    //页面
    return(
        <div>
            <ContextTo.Provider value={{...todo,updateList}}>
                <Context_one/>
                <Context_two/>
            </ContextTo.Provider>
        </div>
    )
}
export default Context_mun